package com.htfyun.ft;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.htfyun.ft.common.FTUtils;
import com.htfyun.ft.config.FTProperty;
import com.htfyun.ft.utils.DebugLog;


public class BootCompletedReceiver extends BroadcastReceiver {

    private final static String TAG = "BootCompletedReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {

        final String action = intent.getAction();
        if (action == null) {
            return;
        }
        DebugLog.e("BootCompletedReceiver action = " + action);
        DebugLog.e("~~~~~ Congratulations: We receive BootCompletedReceiver");
        DebugLog.e("FTUtils.isFTPassed() =  " + FTUtils.isFTPassed() + ", FTUtils.isPCChecked() = " + FTUtils.isPCChecked());

        if (/*FTUtils.isFTPassed() &&*/ FTUtils.isPCChecked()) {
            //如果已经checked了, 也不弹出测试FT
            return;
        }

        if (action.equalsIgnoreCase(Intent.ACTION_BOOT_COMPLETED)) {

            FTUtils.startMainActivity();

        }
    }


}
